package logic;
import java.awt.Point;
import java.awt.Rectangle;
import java.util.Vector;

import main.GameDef;
import visual.Board;


public class Piece implements Manipulable, GameDef{
/*
 * Atributes
 */	
	final public static int INACTIVE	= 0;
	final public static int ACTIVE		= 1;
	public Rectangle position;
	public Vector <Block>blocks;
	public int type;
/*
 * Constructors
 */
	public Piece(int numBlocks, int pieceType){
		type = pieceType;
		blocks = new Vector <Block>(numBlocks);
		for(int i = 0; i < numBlocks; i++){
			blocks.add(new Block(hashCode(), i));
		}
	}
	
/*
 * Setters
 */

	public boolean isHit(Point point) {
//		for(int i = 0; i < blocks.size(); i++){
//			if(blocks.get(i).position.contains(point)){
//				return true;
//			}
//		}
		return false;
	}
	
	public int remainingBlocks(){
		return 0; //devuelve la cantidad de blockes restantes en la pieza
	}
	
	public boolean repairBlock(Block block){
		return false; //devuelve si puede o no reparar el bloque verificando que la pieza este 'viva'
	}
	
	public void arrangeBlocks(Rectangle rect, int width, int height){
//		for(int i = 0; i < width; i++){
//			for(int j = 0; j < height; j++){
//				Rectangle r = blocks.get((i * width) +  j).position;
//				r.setLocation(rect.x + (i * Board.PIECE_WIDTH), rect.y + (j * Board.PIECE_WIDTH));
//			}
//		}
	}
}
